Repository navigation
Fix the Statistics dialog clearing columns as soon as one is selected. #2018 - #10691
kundansable wants to merge 2 commits into
Conversation
…pgadmin-org#2018 The columns field's depChange also fires on the field's own changes, so selecting a column reset the selection. Clear it only when the schema or table changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Conditional column selection clearing web/pgadmin/browser/server_groups/servers/databases/schemas/statistics/static/js/statistics.ui.js, web/regression/javascript/schema_ui_files/statistics.ui.spec.js |
The handler clears columns only when the change source is schema or table. The regression test checks that changing columns itself does not clear its value and that schema or table changes clear it. |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Suggested reviewers: asheshv
Merge Risk: 
Minimal · up to 9b573
-
The Statistics column-selection fix is covered by the regression test and is mergeable.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
🟢 Approval recommended
The narrow guard addresses the selection bug while preserving context resets; the optional regression-test suggestion is non-blocking.
1 open issue
What changed in this PR
Fixes column selection in the Statistics Create dialog by limiting selection resets to changes in the table context.
Changes:
- Preserves selected columns when the columns field changes.
- Continues clearing columns when the schema or table changes.
- Adds comments explaining why the callback ignores its own field changes.
| File | Description |
|---|---|
| web/pgadmin/browser/server_groups/servers/databases/schemas/statistics/static/js/statistics.ui.js | Guards the column-reset callback by the changed field. |
Review effort: Balanced
…rg#2018 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks! Squashed and merged as 60117eb. |

Problem
In the Statistics Create dialog, selecting a column immediately cleared the selection, so columns could not be chosen.
Cause
The
columnsfield'sdepChangealso fires on the field's own changes, so every selection resetcolumnsto[].Fix
Reset the columns only when the
schemaortablefield changes.Testing
Manually in the UI: picked table
t, selected columnsaandb; both stayed selected and Save became enabled.🤖 Generated with Claude Code
Summary by CodeRabbit